<template>
	<view class="xqy">
		<view class="list">
			<view class="img">
				<image :src="xqyshop.small_image"></image>
			</view>
			<view class="price">
				<text>￥{{xqyshop.price}}</text>
				<text>￥{{xqyshop.origin_price}}</text>
				<text>销量：{{xqyshop.total_sales}}</text>
			</view>
			<view class="shopname">
				<text>{{xqyshop.product_name}}</text>
				<view>{{xqyshop.spec}}</view>
			</view>
			<view class="gwc" @click="add(xqyshop)">
				<view >
					加入购物车
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {mapMutations} from 'vuex'
	export default {
		data() {
			return {
				xqyshop:[]
			};
		},
		
		onLoad(option) {
			const item = JSON.parse(decodeURIComponent(option.xqyshop));
			this.xqyshop = item
		},
		methods:{
			...mapMutations(['add'])
		}
	}
</script>

<style lang="scss">
.xqy{
	background-color: #fff;
	.list{
		.img{
			border-bottom: 1px solid #d1d1d1;
			image{
				width: 750rpx;
				height: 750rpx;
			}
		}
		.price{
			padding: 20rpx 20rpx 0 20rpx;
			text{
				color: #d81e06;
				font-weight: 700;
				font-size: 50rpx;
				&:nth-child(2){
					color: #d1d1d1;
					font-size: 30rpx;
					margin-left: 20rpx;
					font-weight: 400;
					text-decoration: line-through;
				}
				&:nth-child(3){
					color: #c1c1c1;
					font-size: 30rpx;
					margin-left: 210rpx;
					font-weight: 400;
					text-align: right;
				}
			}
			
		}
		.shopname{
			padding: 20rpx;
			text{
				color: #000;
				font-size: 40rpx;
			}
			view{
				color: #d1d1d1;
				font-size: 30rpx;
			}
		}
		.gwc{
			view{
				color: #fff;
				width: 240rpx;
				height: 80rpx;
				margin-left: 470rpx;
				margin-top: 100rpx;
				text-align: center;
				line-height: 80rpx;
				border-radius: 40rpx;
				background-color: #d81e06;
			}
		}
	}
}
</style>
